<template>
  <div class="out">
    <van-search v-model="value" @focus="$router.push('/search')" shape="round" background="#f4f4f4" placeholder="请输入搜索关键词" />
    <div class="search-bottom">
      <img src="@/assets/store1.png" alt="" />
      <img src="@/assets/store2.png" alt="" />
    </div>
    <StoreTjMain v-for="v in mainArr" :key="v.activityId" :data="v" />
    <!-- 可能喜欢 -->
    <p class="like">你可能喜欢</p>
    <ul>
      <StoreTjLike v-for="v in likeArr" :key="v.dealid" :v="v" />
    </ul>
  </div>
</template>

<script>
import getLink from '@/api/getLink.js';
import StoreTjMain from './store-tj-main.vue';
import StoreTjLike from './store-tj-like.vue';
export default {
  components: {
    StoreTjMain,
    StoreTjLike,
  },
  data() {
    return {
      value: '',
      mainArr: [],
      likeArr: [],
    };
  },
  created() {
    getLink('/api/store/tj').then(ok => (this.mainArr = ok.data));
    getLink('/api/store/tj/like').then(ok => (this.likeArr = ok.data));
  },
};
</script>

<style lang="less" scoped>
.out {
  background-color: #f4f4f4;
  padding: 0.1rem;
  box-sizing: border-box;
  width: 100%;
  .like {
    font-size: 0.3rem;
    margin: 0.2rem 0;
    padding-left: 0.4rem;
  }
  .van-search__content {
    background-color: white;
  }
  .search-bottom {
    display: flex;
    width: 100%;
    box-sizing: border-box;
    justify-content: space-around;
    img {
      width: 3.1rem;
      height: 1.2rem;
      border-radius: 0.2rem;
    }
  }
  ul {
    padding: 0.3rem;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
  }
}
</style>
